import java.util.Random;
import java.util.Scanner;

/**
 * @author ：wang-ting
 * @Date：2025/3/16 19:34
 */
public class GuessingNumbers {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Random random = new Random();//电脑随机生成一个数
        //int randNum = random.nextInt(101);//[0,101)-->[0,100]
        int randNum = random.nextInt(100)+1;//[1,101)
        while(true){
            System.out.println("请输入你要猜的数字");
            int num = sc.nextInt();
            if(num < randNum){
                System.out.println("猜小了");
            }else if(num == randNum){
                System.out.println("猜对啦");
                break;//猜对了就跳出循环
            }else{
                System.out.println("猜大了");
            }

        }

    }
}
